﻿<Window x:Class="Profit.Views.PortraitView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:Profit.Controls" 
        mc:Ignorable="d" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        d:DesignHeight="180" d:DesignWidth="350" 
        ShowInTaskbar="False"
        SizeToContent="WidthAndHeight"
        MinHeight="180" MinWidth="350" Icon="/Profit;component/Resources/Icons/app_32.ico">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="1*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="1*" MinHeight="32"/>
            </Grid.RowDefinitions>
            
            <Label Content="Image URI : " VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Column="0" Grid.Row="0"/>
            <TextBox Text="{Binding ImagePath, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Grid.Column="1"  VerticalAlignment="Center" HorizontalAlignment="Stretch"/>

            <StackPanel Orientation="Horizontal"  Grid.Row="0" Grid.Column="2" >
                <Button Command="{Binding ClearCommand}" Content="Clear" Style="{StaticResource FlatButtonStyle}" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                <Button Command="{Binding BrowseCommand}" Content="Select" Style="{StaticResource FlatButtonStyle}" Margin="5,5,11,5" VerticalAlignment="Center" HorizontalAlignment="Center"/>
            </StackPanel>
            
            <Label Content="Current image :" VerticalAlignment="Top" HorizontalAlignment="Right"  Grid.Row="1" Grid.Column="0" />
            <Image Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top" Source="{Binding ImageUri}" MaxWidth="64" MaxHeight="64" MinWidth="32" MinHeight="32" />
            
        </Grid>
        
        <local:DialogActionsPanel
            Grid.Row="2" 
            HorizontalAlignment="Right"
            VerticalAlignment="Bottom"
            ShowButtonCancel="True"
            ButtonOkCommand="{Binding ValidateCommand}" />
    </Grid>
</Window>
